## 1
uname
set pd =  $(ps aux|grep java|grep work|awk '{print $2}')
if [ "$pd" != "" ];then
 kill -9 $pd
fi
nohup java -jar www/work-*.*.*.jar -Dfile.encoding=utf-8 >>  www/work.log &
sleep 10
cat www/work.log
echo 'task finished'

## 2
uname
pd=$(ps aux|grep -v grep |grep java|grep work|awk '{print $2}')
if [ "$pd" != "" ];then kill -9 $pd; fi

cp service/work.log log/work`date '+%Y%m%d%H%M%S'`.log
rm -f service/work.log
nohup java -jar service/work-*.*.*.jar -Dfile.encoding=utf-8 >>  service/work.log &
sleep 20
cat service/work.log
echo 'task finished'
